home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
The World of Computer Software.iso
/
pbaseiv.zip
/
P4SPR001.TIP
< prev
next >
Wrap
Text File
|
1991-12-16
|
3KB
|
65 lines
Lotus's 1-2-3 recognizes dates in the next century, but only
if you type three-digit year values like 101 for the year
2001 or 110 for 2010, or use the full four-digit years. When
you're entering a lot of dates, one- or two-digit years like
2 or 12 are much easier to type, but these translate to 1902
and 1912--not years for which you're likely to do much
financial planning.
For worksheets that forecast into the next century, I wrote
a macro that lets me enter twenty-first--century dates as
two-digit years. The macro works by adding @date(99,12,31)
to @date(year,month,day)--where `year' is the label of a
cell that holds a value from 0 to 89--effectively adding a
century to the year typed. Because such dates display in
Long Int'l format (MM/DD/YYYY), I increase the column width
to at least 11 for the macro's target cells.
David H. Noble
Roanoke, Virginia
Editor's note: This macro [included in the file
P4SPREAD\CENTURY.WK1 on your PowerBase *.* Volume IV
diskette] works equally well in 1-2-3 and Quattro Pro.
If you want to create it from scratch, type the macro in the
listing below into six out-of-the-way cells, pressing '
before the last line. Use /Range Name Create to name the
first cell \d and to name three other out-of-the-way cells
Month, Day, and Year.
To run the macro, press <Alt>-D, then answer the prompts for
the month, day, and year values. The current column must be
at least 11 characters wide. To see how the macro converts
years, run it several times with such year values as 2, 45,
and 91.
I modified Mr. Noble's original macro to recognize values
from 90 to 99 as the years 1990 to 1999. Values from 0 to 89
correspond to the years 2000 to 2089. To change this, adjust
the expressions at rows 4 and 5. For example, if you want 50
to 99 to represent the years 1950 to 1999 and 0 to 49 to
mean the years 2000 to 2049, change `90' to 50 and `89' to
49.
This macro lets you enter dates in the 21st century easily.
A B C D E F
1 \d {getnumber "Enter Month: ",month}
2 {getnumber "Enter Day: ",day}
3 {getnumber "Enter Year: ",year}
4 {if year<90}@date(year,month,day)+@date(99,12,31)~
5 {if year>89}@date(year,month,day)~
6 /rfd4~/rv~~
7
8 Year 1 11/25/2001
9 Month 11
10 Day 25
Title: 2001: A Worksheet Oddity
Category: SPR
Issue date: Jan 1991
Editor: Tom Swan
Supplementary files: P4SPREAD\CENTURY.WK1